using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class RD_ScanMap : EntityTypeConfiguration<RD_Scan>
    {
        public RD_ScanMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.Object)
                .HasMaxLength(50);

            this.Property(t => t.KeyValue)
                .HasMaxLength(50);

            this.Property(t => t.ScanSession)
                .HasMaxLength(30);

            this.Property(t => t.Table)
                .HasMaxLength(50);

            this.Property(t => t.reference)
                .HasMaxLength(50);

            this.Property(t => t.KeyType)
                .IsFixedLength()
                .HasMaxLength(1);

            this.Property(t => t.Message)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("RD_Scan");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.Object).HasColumnName("Object");
            this.Property(t => t.Published).HasColumnName("Published");
            this.Property(t => t.KeyValue).HasColumnName("KeyValue");
            this.Property(t => t.Action).HasColumnName("Action");
            this.Property(t => t.ScanSession).HasColumnName("ScanSession");
            this.Property(t => t.Table).HasColumnName("Table");
            this.Property(t => t.reference).HasColumnName("reference");
            this.Property(t => t.KeyType).HasColumnName("KeyType");
            this.Property(t => t.Status).HasColumnName("Status");
            this.Property(t => t.Message).HasColumnName("Message");
        }
    }
}
